/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;

import java.io.Serializable;
import java.sql.*;


/**
 *
 * @author Elizangela
 */
public class Conexao {
    private String driver = "com.mysql.jdbc.Driver";
    private String url = "jdbc:mysql://localhost:3306/forhentbd";
    private String login = "root";
    private String senha = "";
    private Connection con;    
    
     public Conexao() {         
         
        try {
            Class.forName(driver);
            con = DriverManager.getConnection(url,login, senha);             
        }catch (Exception e) {
            e.printStackTrace();
        }
       }
        
        public Connection getCon() {
            return con;
        }
        
        public void fecharConexao(){
        try {
            con.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }
 }
}
